<template>
  <div>
    <div class="title">
      <img class="title-img" src="http://img1.qunarzz.com/piao/fusion/1711/89/ebc329f16c55bb02.png" />
      热销推荐
    </div>
    <ul>
      <router-link
        tag="li"
        class="content border-bottom"
        v-for="item of list"
        :key="item.id"
        :to="'/detail/' + item.id"
      >
        <img class="content-img" :src="item.imgUrl" />
        <div class="img-info">
          <p class="img-title">{{item.title}}</p>
          <p class="img-desc">{{item.desc}}</p>
          <button class="img-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .title
    margin-top: .1rem
    line-height: .94rem
    padding-left: .2rem
    font-size: .32rem
    background: #F5F5F5
    .title-img
      display: inline-block
      height: .32rem
      width: .32rem
      vertical-align: text-top
  .content
    overflow: hidden
    display: flex
    height: 2.4rem
    .content-img
      width: 2rem
      height: 2rem
      padding: .2rem
    .img-info
      flex: 1
      padding: .2rem
      min-width: 0
      .img-title
        line-height: .64rem
        font-size: .32rem
        ellipsis()
      .img-desc
        line-height: .44rem
        color: #CCCCCC
        ellipsis()
      .img-button
        line-height: .44rem
        margin-top: .32rem
        background: #FF9300
        border-radius: .06rem
        padding: 0 .2rem
        color: #FFFFFF
</style>
